package com.example.security_demo.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * RBAC 基于角色的权限控制
 * 用户表 角色表 权限表(api, 控件)
 * 基于username 获取到用户Id 然后通过Id获取到角色，以及其对应的权限
 * @author zzh
 * @date 2022/5/11
 * @since 1.0
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserVo {

    private Long userId;

    private String userName;

    private String password;

    private boolean isEnable;


    public UserVo (User user) {
        this.userId = user.getUserId();
        this.password = user.getPassword();
        this.isEnable = user.isEnable();
    }

}
